-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enough types to pass mypy #177
Conversation
Test Results 116 files + 106 116 suites +106 1h 25m 13s ⏱️ + 1h 25m 13s For more details on these failures and errors, see this check. Results for commit 81c7628. ± Comparison against base commit 4c78edd. ♻️ This comment has been updated with latest results. |
As far as I can tell, the largest flaw in how I've done this so far is that I tried to make Endness an actual type. I may revert that and just type it as |
I don't think your current endness enum will actually work without 3.11's StrEnum - we have wayyyyyyyy too much legacy code that does direct comparisons with Iend_LE and friends |
Yep. I saw StrEnum in the docs and figured that might be a good fit, but it's 3.11 and I don't see us bumping the min version for that. Doing it the way I did here would require a medium size refactor, mostly in angr proper (got cle and pyvex tests passing locally). We could consider backporting it on python<3.11. |
81c7628
to
48f6f0c
Compare
for more information, see https://pre-commit.ci
This fixes up typing issues enough to pass mypy when run as follows:
mypy --ignore-missing-import archinfo
After this, we may want to consider implementing type stubs for capstone, keystone, and unicorn, as well as type more functions and/or use
--check-untyped-defs
. By default mypy does not check untyped functions. nor do they pass as of this PR.Also todo: CI.
sync: angr/pyvex#356